<%= javascript_include_tag "jquery/jquery.fancybox-1.3.4.js" %>
<%= stylesheet_link_tag "jquery.fancybox-1.3.4.css" %>
<script>

$(document).ready(function(){
   $("a[rel=group]").fancybox({
  'transitionIn' : 'elastic',
  'transitionOut' : 'elastic',
  'overlayColor' : '#4c7d08',
      'titlePosition' : 'over',
      'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
      return '<span id="fancybox-title-over">图片 ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
      }
  });    
})
</script>

<h2 class="title2">
	<%= @news.title %>
	<em>发布时间：<%= @news.created_at.strftime("%Y-%m-%d") %></em>
</h2>

	<%= render :partial => "share/share", :locals => {:title => @news.title } %>

<div class="article-content">
	<%= @news.content.bbcode_to_html %>
</div>

<ul class="show-image-list">
  <% @news.images.each do |image| %>
    <li>
      <a href="<%= image.image.url %>" title="<%= image.description %>" rel="group"><%= image_tag image.image.url(:thumb) %></a>
    </li>
  <% end %>
</ul>

<p class="category-tag">
	<%= image_tag("category.gif") %>
	<%= @news.categories.collect{|category| 
		link_to category.name, {:controller => "news",:category_id => category.id}, {:title => category.name}
	}.join("&nbsp;&nbsp;|&nbsp;&nbsp;")  %>
</p>




